//@Lim Wei Ke A0083402R
package logic;

import static org.junit.Assert.*;

import java.util.ArrayList;

import org.junit.Test;

import storage.Storage;

public class DeleteCommandTest {

	@Test
	public void test() {
		
		ArrayList<Integer> indexArr = new ArrayList<Integer>();
		ArrayList<String> filenames = new ArrayList<String>();
		
		DeleteCommand delete1 = new DeleteCommand(indexArr, false, true, "");
		String feedback1 = delete1.execute().get(0);
		assertEquals("0 task(s) deleted.\n", feedback1);
		
		indexArr.add(1);	
		Storage.init();
		ArrayList<String> storageList = Storage.getFileNameList();
		filenames.add(storageList.get(0));
		ExecutionHandler.setDisplayFileNames(filenames);
		
		DeleteCommand delete2 = new DeleteCommand(indexArr, false, true, "");
		String feedback2 = delete2.execute().get(0);
		assertEquals("1 task(s) deleted.\n", feedback2);
		
		indexArr.clear();
		DeleteCommand delete4 = new DeleteCommand(indexArr, true, true, "");
		String feedback4 = delete4.execute().get(0);
		assertEquals("All tasks deleted.\n", feedback4);
		
	}

}
//@Lim Wei Ke A0083402R